﻿<%@ Page Title="" Language="C#" MasterPageFile="~/HRSys.Master" AutoEventWireup="true"
    CodeBehind="EditAuthority.aspx.cs" Inherits="HRWebSite.Sys.EditAuthority" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<title id="Title1" runat="server">权限管理</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <table>
            <tr>
                <td class="td-odd">权限标识
                </td>
                <td class="td-even"><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </td>
                <td class="td-but"><asp:Button ID="Button1" runat="server" Text="添加" OnClick="Button1_Click" />
                </td>
            </tr>
            <tr>
                <td class="td-odd">权限名称
                </td>
                <td  colspan="2" class="td-even"><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                
            </tr>
            <tr>
                <td class="td-odd">
                </td>
                <td colspan="2" class="td-even"><asp:CheckBox ID="RadioButton1" runat="server" Checked="true" Text="启用" />
                </td>               
            </tr>
        </table>        
        <asp:Literal ID="Literal1" runat="server"></asp:Literal>
    </div>
    <div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CellPadding="4" DataKeyNames="EnID" DataSourceID="SqlDataSource1" ForeColor="#333333"
            GridLines="None" Width="826px" PageSize="20">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="EnID" HeaderText="标识" ReadOnly="True" 
                    SortExpression="EnID" />
                <asp:BoundField DataField="LimitName" HeaderText="名称" 
                    SortExpression="LimitName" />
                <asp:CheckBoxField DataField="Used" HeaderText="启用" SortExpression="Used" />
                <asp:CommandField CancelText="取消" DeleteText="删除" EditText="编辑" HeaderText="操作 "
                    InsertText="添加" NewText="添加" SelectText="选择" ShowDeleteButton="True" ShowEditButton="True"
                    UpdateText="更新">
                    <ItemStyle Width="150px" />
                </asp:CommandField>
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HRSys %>"
            DeleteCommand="DELETE FROM [Limit] WHERE [EnID] = @EnID" InsertCommand="INSERT INTO [Limit] ([EnID], [LimitName], [Used]) VALUES (@EnID, @LimitName, @Used)"
            SelectCommand="SELECT * FROM [Limit]" UpdateCommand="UPDATE [Limit] SET [LimitName] = @LimitName, [Used] = @Used WHERE [EnID] = @EnID">
            <DeleteParameters>
                <asp:Parameter Name="EnID" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="EnID" Type="String" />
                <asp:Parameter Name="LimitName" Type="String" />
                <asp:Parameter Name="Used" Type="Boolean" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="LimitName" Type="String" />
                <asp:Parameter Name="Used" Type="Boolean" />
                <asp:Parameter Name="EnID" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
